package model;
public class Reader {
    private String readerId;
    private String name;
    private int borrowCount;
    public Reader(String readerId, String name) {
        this.readerId = readerId;
        this.name = name;
        this.borrowCount = 0;
    }
    public String getReaderId() {
        return readerId;
    }
    public int getBorrowCount() {
        return borrowCount;
    }
    public void addBorrowCount() {
        this.borrowCount++;
    }
    public void reduceBorrowCount() {
        this.borrowCount--;
    }
    public boolean canBorrow() {
        return this.borrowCount < 3;
    }
    @Override
    public String toString() {
        return "读者信息：证号=" + readerId + "，姓名=" + name + "，已借数量=" + borrowCount;
    }
}